#!/home/hadoop/python26/bin/python
import json
import sys
import hashlib
import string

for line in sys.stdin:
    r = None
    w = line.strip().split('\t')
    local_buffer = []
    for t in w[1:]:
        try:
            r = json.loads(t)
            date = r['date']
            id = r['id']
            table = r['table_id']
            user_id = r['user_id']
            local_buffer.append((date,id,table,user_id))
        except:
            continue
    local_buffer = sorted(local_buffer, key = lambda x: x[0])
    if local_buffer[0][2] != 'target':
        output_str_buffer = []
        for i in range(len(local_buffer)):
            output_str_buffer.append(str(local_buffer[i][0]) + ':' + str(local_buffer[i][1]) + ':' + str(local_buffer[i][2]) + ':' + str(local_buffer[i][3]))
        output_s = '\t'.join(output_str_buffer)
        print output_s
        
            
    
